From f1a4dd154546119863e07bea60a405243d22969e Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Thu, 6 Nov 2008 11:50:21 +0000 Subject: [PATCH] x86, hvm: Better MTRR type check. From: Disheng Su Signed-off-by: Keir Fraser --- xen/arch/x86/hvm/mtrr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/mtrr.c b/xen/arch/x86/hvm/mtrr.c index 7344576f16..d6692d2b3d 100644 --- a/xen/arch/x86/hvm/mtrr.c +++ b/xen/arch/x86/hvm/mtrr.c @@ -392,7 +392,10 @@ uint32_t get_pat_flags(struct vcpu *v, */ if ( pat_entry_value == INVALID_MEM_TYPE ) { - if (mfn_valid(paddr_to_pfn(spaddr))) + struct domain *d = v->domain; + p2m_type_t p2mt; + gfn_to_mfn(d, paddr_to_pfn(gpaddr), &p2mt); + if (p2m_is_ram(p2mt)) gdprintk(XENLOG_WARNING, "Conflict occurs for a given guest l1e flags:%x " "at %"PRIx64" (the effective mm type:%d), " -- 2.30.2